/*
 * File:   ipc_manager.h
 * Author: dolphinigle
 *
 * Created on December 3, 2011, 7:43 AM
 */

#ifndef IPC_MANAGER_H
#define	IPC_MANAGER_H

#include <cassert>

#include <string>
using std::string;

class IPCManager {
public:
  IPCManager(int target_msq_id, int input_msq_id)
      : target_msq_id_(target_msq_id), input_msq_id_(input_msq_id) {}

  void SendMessage(string message);

  string ReceiveMessage();

  static const int kMaxMessageSize = 100000;
private:
  // Length of text transmitted, in bytes.
  static const int kMessageLengthLength = 10;

  int target_msq_id_, input_msq_id_;

  struct MessageQueueBuffer {
    long    type;
    char    text[kMaxMessageSize];
  };

  MessageQueueBuffer buffer_;

  IPCManager(const IPCManager& orig) {
  }

  bool operator=(const IPCManager& orig) {
  }
};

#endif	/* IPC_MANAGER_H */

